import org.codehaus.groovy.grails.commons.GrailsClassUtils as GCU
import net.chrisrichardson.ec2deployer.cluster.*
import net.chrisrichardson.ec2deployer.core.*
import static CloudToolsPluginUtil.withCluster


grailsHome = Ant.project.properties."environment.GRAILS_HOME"

includeTargets << new File("${grailsHome}/scripts/Init.groovy")

target('default': "Stop the cluster") {
    doStuff()
}

target(doStuff: "The implementation task") {

    withCluster {ClusterManager clusterManager, String clusterName, SimpleCluster cluster ->
        cluster.stop()
        clusterManager.removeCluster (clusterName)
    }
    event("StatusFinal", ["Stopped cluster"])

}
